<script type="text/javascript" charset="utf-8" >

$(function(){
	
	var url_contact_us =  "<?=site_url(); ?>index.php";
	
	// Add blackbox to each anchor in this pics with ajax options
	$('.pics > .pics_item > a').each(function(index){
		
		// Each item add fancybox
		$(this).fancybox();
		
	});
	
	// Add even to paging link 's picture div 
	$('.pics .paging >a').each(function(index){
		
		$(this).click(function(event){
			
			event.preventDefault();
			
			// Get href attribute 's anchor
			var local_url = $(this).attr('href');
						
			console.log(url_contact_us+'/'+local_url);		
			

			$(this).parents('.pics').load(url_contact_us+'/'+local_url, function(){
				// Load picture div successfully !
			});

			
		});
		
	});
	
});

</script>
<?php if (!empty($images) && isset($images)) : ?>

<?php foreach ($images as $item) :?>

	<div class="pics_item">
		<a href="<?=site_url().'index.php/home/product_detail/'.$type.'/'.$item->id;?>" >
		<img src="<?=base_url().$this->config->item('fd_product_image_url').$item->url;?>" border="0" title="<?=$item->name;?>"/>
			<span><?=$item->name;?></span>
		</a>
	</div>

<?php endforeach; ?>

<?php else : ?>

	<?=$this->lang->line('lmg_images_empty');?>

<?php endif ; ?>

<div style="clear:both"></div>
<div class="paging">
	<?=$images_link;?>
</div>
